const axios = require('axios')
const baseURL = 'http://localhost:3000'

// 删除图片
export async function delCategoryImg(params) {
  console.log('删除图片数据')
  console.log(params)
  return await axios({
    method: 'post',
    url: baseURL + '/api/delCategoryImg',
    data: {
      file_id: params
    }
  })
}

// 添加商品分类
export async function addCategory(params) {
  console.log('添加商品分类')
  console.log(params)
  return await axios({
    method: 'post',
    url: baseURL + '/api/addCategory',
    data: {
      ...params
    }
  })
}

// 单cloud路径转换http路径
export async function cloudToHttp(params) {
  console.log('单cloud路径转换http路径')
  console.log(params)
  return await axios({
    method: 'post',
    url: baseURL + '/api/cloudToHttp',
    data: {
      params
    }
  })
}
